home *** CD-ROM | disk | FTP | other *** search
- //FRAME DIRECTOR
- function setFrames(menubar,something) {parent.contents.document.location.href= something;
- document.location.href = menubar;
- }
-
- function setFrames2(menubar,something) {parent.contents.document.location.href= something;
- parent.menubar.document.location.href = menubar;
- }
-
- // ROTATING ADS
-
- //Laurence Kwek - last modified 25 September 2001
-
- //User defined variables - change these variables to alter the behaviour of the script
- var ImageFolder = "../ads/images/"; //Folder name containing the images for product page
- var ImageFolderindex = "ads/images/"; //Folder name containing the images for main page
- var ImageFileNames = new Array('new_02.gif','sub_banner.gif'); //List of images to use
- var ImageURLs = new Array('http://www.wordgenius.com.au/','../interfce/frmesub2.htm'); //List of hyperlinks associated with the list of images
- var ImageURLsindex = new Array('http://www.wordgenius.com.au/','interfce/frmesub2.htm'); //List of hyperlinks associated with the list of images
- var DefaultURL = 'default.htm'; //Default hyperlink for the Banner Ad
- var DisplayInterval = 5; //Number of seconds to wait before the next image is displayed
- var TargetFrame = "parent"; //Name of the frame to open the hyperlink into
-
- //Internal variables (do not change these unless you know what you are doing)
- var IsValidBrowser = false;
- var BannerAdCode = 0;
- var BannerAdImages = new Array(NumberOfImages);
- var DisplayInterval = DisplayInterval * 2000;
- var NumberOfImages = ImageFileNames.length;
-
- //Add a trailing forward slash to the ImageFolder variable if it does not already have one
- if (ImageFolder.substr(ImageFolder.length - 1, ImageFolder.length) != "/" && ImageFolder != "") { ImageFolder += "/";
- }
-
- if (TargetFrame == '') {
- var FramesObject = null;
- } else {
- var FramesObject = eval('parent.' + TargetFrame);
- }
-
- //Function runs when this page has been loaded and does the following:
- //1. Determine the browser name and version (since the script will only work on Netscape 3+ and Internet Explorer 4+).
- //2. Start the timer object that will periodically change the image displayed by the Banner Ad.
- //3. Preload the images used by the Banner Ad rotator script
-
- //Banner ads display for product page
- function InitialiseBannerAdRotator() {
-
- //Determine the browser name and version
- //The script will only work on Netscape 3+ and Internet Explorer 4+
- var BrowserType = navigator.appName;
- var BrowserVersion = parseInt(navigator.appVersion);
-
- if (BrowserType == "Netscape" && (BrowserVersion >= 3)) {
- IsValidBrowser = true;
- }
-
- if (BrowserType == "Microsoft Internet Explorer" && (BrowserVersion >= 4)) {
- IsValidBrowser = true;
- }
-
- if (IsValidBrowser) {
- TimerObject = setTimeout("ChangeImage()", DisplayInterval);
- BannerAdCode = 0;
-
- for (i = 0; i < NumberOfImages; i++) {
- BannerAdImages[i] = new Image();
- BannerAdImages[i].src = ' ' + ImageFolder + ImageFileNames[i];
- }
- }
- }
-
- //Banner ads display for main page
- function InitialiseBannerAdindex() {
-
- //Determine the browser name and version
- //The script will only work on Netscape 3+ and Internet Explorer 4+
- var BrowserType = navigator.appName;
- var BrowserVersion = parseInt(navigator.appVersion);
-
- if (BrowserType == "Netscape" && (BrowserVersion >= 3)) {
- IsValidBrowser = true;
- }
-
- if (BrowserType == "Microsoft Internet Explorer" && (BrowserVersion >= 4)) {
- IsValidBrowser = true;
- }
-
- if (IsValidBrowser) {
- TimerObject = setTimeout("ChangeImage()", DisplayInterval);
- BannerAdCode = 0;
-
- for (i = 0; i < NumberOfImages; i++) {
- BannerAdImages[i] = new Image();
- BannerAdImages[i].src = ' ' + ImageFolderindex + ImageFileNames[i];
- }
-
- }
-
- }
- //Function to change the src of the Banner Ad image
- function ChangeImage() {
-
- if (IsValidBrowser) {
- BannerAdCode = BannerAdCode + 1;
-
- if (BannerAdCode == NumberOfImages) {
- BannerAdCode = 0;
- }
-
- window.document.bannerad.src = BannerAdImages[BannerAdCode].src;
- TimerObject = setTimeout("ChangeImage()", DisplayInterval);
- }
- }
-
- //Function to redirect the browser window/frame to a new location,
- //depending on which image is currently being displayed by the Banner Ad.
- //If Banner Ad is being displayed on an old browser then the DefaultURL is displayed
-
- //changepage for product page
- function ChangePage() {
-
- if (IsValidBrowser) {
-
- if (TargetFrame != '' && (FramesObject)) {
- FramesObject.location.href = ImageURLs[BannerAdCode];
- } else {
- document.location = ImageURLs[BannerAdCode];
- }
-
- } else if (!IsValidBrowser) {
- document.location = DefaultURL;
- }
- }
-
-
- function ChangePageindex() {
-
- if (IsValidBrowser) {
-
- if (TargetFrame != '' && (FramesObject)) {
- FramesObject.location.href = ImageURLsindex[BannerAdCode];
- } else {
- document.location = ImageURLsindex[BannerAdCode];
- }
-
- } else if (!IsValidBrowser) {
- document.location = DefaultURL;
- }
- }
-
- //changepage for main
- /*function ChangePageindex() {
- if (IsValidBrowser) {
- if (TargetFrame != '' && (FramesObject)) {window.open(ImageURLsindex[BannerAdCode]);}
- else {window.open(ImageURLsindex[BannerAdCode]);}
- }
- else if (!IsValidBrowser) {window.open(DefaultURL);
- }
- }*/
-
-
- // ROLLOVER FUNCTIONS
- function MM_swapImgRestore() { //v3.0
- var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
- }
-
- function MM_preloadImages() { //v3.0
- var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
- var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
- if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
- }
-
- function MM_findObj(n, d) { //v4.0
- var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
- d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
- if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
- for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
- if(!x && document.getElementById) x=document.getElementById(n); return x;
- }
-
- function MM_swapImage() { //v3.0
- var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
- if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
- }
-
-